package com.example.gongming.fenshux;

import junit.framework.TestCase;

/**
 * Created by Gongming on 2015/9/9.
 */
public class ApplicationTestTest extends TestCase {

    GFenshu f1,f2;
    public void setUp() throws Exception {
        super.setUp();

        f1=new GFenshu(1,2);
        f2=new GFenshu(1,3);
    }

    public void tearDown() throws Exception {
    }

    public void testAdd(){

        GFenshu f3=f1.add(f2);
        GFenshu f4=f1.sub(f2);

        assertEquals(f3.getFenzi(), 1);
        assertEquals(f3.getFenmu(),6);

        assertEquals(f4.getFenzi(),1);
        assertEquals(f4.getFenmu(),6);
    }
}